<template>
  <div class="container">
    <div class="classify_open">
      <div class="classify_left">
        <ul class="classify_left_man">
          <li
            v-for="(item, index) in Object.keys(man_goods)"
            :key="item"
            @click="changeIssue(index)"
          >
            {{ item }}
          </li>
        </ul>
      </div>
      <div class="classify_middle">
        <ul class="classify_left_man">
          <li
            v-for="item in Object.values(man_goods)[currentIndex]"
            :key="item"
            @click="toTitle(item)"
          >
            {{ item }}
          </li>
        </ul>
      </div>
      <div class="classify_right">
        <img
          :src=images[currentIndex]
          alt=""
        />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "ProductIssue",
  data() {
    return {
      man_goods: {
        "外套": ["羽绒", "茄克", "大衣", "针织衫"],
        "衬衫": ["休闲", "商务", "牛津纺"],
        "裤装": ["牛仔裤", "短裤", "高弹力"],
        "T恤&背心": ["POLO衫", "长袖T恤", "背心"],
      },
      currentIndex: 0,
      images:[
      "https://www.louisvuitton.cn/images/is/image/lv/1/VE_DI2_L/%E8%B7%AF%E6%98%93%E5%A8%81%E7%99%BB--Men_MM_RTW_Staples_april_DI2.jpg?wid=944&hei=1064",
      "https://www.louisvuitton.cn/images/is/image/lv/1/P…7%99%BB--Men_MM_RTW_Shirts_Sept21_DI2.jpg?wid=824",
      "https://www.louisvuitton.cn/images/is/image/lv/1/P…E7%99%BB--Men_MM_RTW_Pants_Sept21_DI2.jpg?wid=824",
      "https://www.louisvuitton.cn/images/is/image/lv/1/P…81%E7%99%BB--M_Fa_FW21_Campaign_1_DI2.jpg?wid=824"
      ],
      product:{}
    };
  },
  methods: {
    changeIssue(index) {
      this.currentIndex = index;
    },
    toTitle(item) {
      let keyword = item;
      this.$axios
        .get(`/api/product/getProductByMoreKeywords?k1=${keyword}&k2=男&k3=&k4=`)
        .then((res) => {
          this.product = res.data.results;
          this.$router.push({name: 'ProductIssueShow',params:{id:this.product}})
        })
    },
  },
};
</script>
<style scoped>
* {
  margin: 0;
  padding: 0;
}
.container {
  width: 1170px;
  margin: 0 auto;
}
.classify_open {
  width: 100%;
  height: 600px;
  border: 1px solid #ccc;
  display: flex;
  border-radius: 5px;
}

.classify_left {
  flex: 1;
  width: 100%;
  background-color: #fff;
}

.classify_middle {
  flex: 1;
  width: 100%;
  background-color: #f6f5f3;
}

.classify_right {
  flex: 2;
  width: 100%;
  background-color: #f6f5f3;
  overflow: hidden;
}

.classify_right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.6s;
}

.classify_right img:hover {
  transform: scale(1.1);
}

.classify_middle .classify_left_man {
  margin-top: 80px;
}

.classify_left_man {
  list-style: none;
  display: block;
  width: 120px;
  margin: 50px auto;
}

.classify_left_man li {
  height: 50px;
  text-align: center;
  line-height: 50px;
}

.classify_left_man li:hover {
  cursor: pointer;
}

.classify_left_man li::after {
  content: "";
  display: block;
  transition: all 300ms ease-in-out 0s;
  cursor: pointer;
  border-top: 1px solid #000;
  width: 0;
}

.classify_left_man li:hover::after {
  width: 100%;
}
</style>